/**
 * RankSorter.java
 * ************************** 
 * @date May 5, 2011
 * @author Michele Tamburini
 * 
 * **************************
 */
package gossipServices.bootstraping.tman.rankingMethods.rankingComparators;

import gossipServices.bootstraping.tman.rankingMethods.RankingPair;

/**
 * Description: 
 * The RankSorter implements the {@link RankingComparator} interface.
 * It's able to manage two {@link RankingPair} o1 and o2 by comparing their 
 * ranking values, and produces in output:
 * 		-1 if the rank of o1 > o2
 * 		 0 if the two ranks are equals o1 = o2
 * 		 1 if the rank of o2 < o1
 * If applied to a Collection of RankingPair it will sort it 
 * following the increasing order of their ranks.
 * 
 */
public class RankSorter implements RankingComparator {

	/**
	 * 
	 */
	public RankSorter() { }

	@Override
	public int compare(RankingPair o1, RankingPair o2) {
		return o1.getRank().compareTo(o2.getRank());
	}

}
